Use a Property Target Interpolator when you want to dynamically set the target value of a property and want to interpolate the current value to the target value over time. More...
#include <kanzi/core.ui/animation/property_target_interpolator.hpp>
Classes | |
class | CompletedMessageArguments |
Message arguments for Completed message. More... | |
Public Member Functions | |
string | getInterpolatedPropertyType () const |
Gets the value of the InterpolatedPropertyTypeProperty. More... | |
void | setInterpolatedPropertyType (string_view value) |
Sets the value of the InterpolatedPropertyTypeProperty. More... | |
PropertyField | getInterpolatedPropertyField () const |
Gets the value of the InterpolatedPropertyFieldProperty. More... | |
void | setInterpolatedPropertyField (PropertyField value) |
Sets the value of the InterpolatedPropertyFieldProperty. More... | |
float | getAcceleration () const |
Gets the value of the AccelerationProperty. More... | |
void | setAcceleration (float value) |
Sets the value of the AccelerationProperty. More... | |
float | getDrag () const |
Gets the value of the DragProperty. More... | |
void | setDrag (float value) |
Sets the value of the DragProperty. More... | |
![]() | |
virtual | ~NodeComponent () |
Destructor. More... | |
void | setName (string_view name) |
Sets the name of node component. More... | |
string | getName () const |
Gets the name of node component. More... | |
NodeSharedPtr | getNode () const |
Returns the node the node component is attached to or null pointer if node component is not attached to a node. More... | |
void | attach (NodeWeakPtr node) |
Attaches node component to node. More... | |
void | detach () |
Detaches node component from the node it was attached to. More... | |
State | getState () const |
Gets the state of node component indicating if component is attached to a node, detached from any node or in process of attaching/detaching. More... | |
bool | isAttaching () const |
Indicates whether node component is in the process of attaching to a node. More... | |
bool | isAttached () const |
Indicates whether node component is attached to a node. More... | |
bool | isAttachingOrAttached () const |
Indicates whether node component is in the process of attaching to a node or already attached. More... | |
bool | isDetaching () const |
Indicates whether node component currently detaching from the node. More... | |
bool | isDetached () const |
Indicates whether node component is detached from any node. More... | |
bool | isDetachingOrDetached () const |
Indicates whether node component is in the process of detaching from the node or already detached. More... | |
![]() | |
Object (Domain *domain) | |
virtual | ~Object () |
Domain * | getDomain () const |
Returns the domain the object belongs to. More... | |
KzuTaskScheduler * | getTaskScheduler () const |
Returns the task scheduler of the object. More... | |
KzuMessageDispatcher * | getMessageDispatcher () const |
Returns the message dispatcher of the object. More... | |
ResourceManager * | getResourceManager () const |
Returns the resource manager of the object. More... | |
virtual const Metaclass * | getDynamicMetaclass () const KZ_OVERRIDE |
Returns the metaclass of the dynamic type of the object. More... | |
AppliedStyleEntrySharedPtr | applyObjectStyle (kanzi::StyleSharedPtr style) |
Applies a style to an object. More... | |
void | unapplyObjectStyle (AppliedStyleEntrySharedPtr appliedStyleEntry) |
void | applyObjectStyles () |
Apply all styles for an object node. More... | |
void | unapplyObjectStyles () |
Unapplies and removes all applied styles. More... | |
![]() | |
virtual | ~MetaObject () |
bool | isTypeOf (const Metaclass *objectType) const |
Determines if the type of this object is the given type or derived from it. More... | |
![]() | |
PropertyObject () | |
virtual | ~PropertyObject () |
template<typename DataType > | |
void | setProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Traits::ParameterType value) |
Sets the local value of a property. More... | |
void | removeKzbProperties () |
template<typename DataType > | |
PropertyType< DataType >::Traits::ReturnType | getProperty (const PropertyType< DataType > &propertyType) const |
Returns the current value of a property. More... | |
template<typename DataType > | |
optional< typename PropertyType< DataType >::Traits::ReturnType > | getOptionalProperty (const PropertyType< DataType > &propertyType) const |
Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value. More... | |
template<typename DataType > | |
PropertyType< DataType >::Traits::ReturnType | getPropertyBase (const PropertyType< DataType > &propertyType) const |
Returns the current value of a property disregarding modifiers. More... | |
template<typename DataType > | |
void | setAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::Traits::ParameterType value) |
template<typename DataType > | |
PropertyType< DataType >::Traits::ReturnType | getAbstractProperty (AbstractPropertyType abstractPropertyType) const |
template<typename DataType > | |
PropertyType< DataType >::Traits::ReturnType | getAbstractPropertyBase (AbstractPropertyType abstractPropertyType) const |
template<typename DataType > | |
optional< typename PropertyType< DataType >::Traits::ReturnType > | getOptionalAbstractProperty (AbstractPropertyType abstractPropertyType) const |
void | setPropertyFlag (AbstractPropertyType propertyType, uint32_t flag) |
bool | isPropertyFlagSet (AbstractPropertyType propertyType, uint32_t flag) const |
void | clearPropertyFlag (AbstractPropertyType propertyType, uint32_t flag) |
bool | hasValue (AbstractPropertyType propertyType) const |
Evaluates whether there are any inputs into the property value. More... | |
bool | hasBaseValue (AbstractPropertyType propertyType) const |
Evaluates whether there are any inputs into the property value, disregarding modifiers. More... | |
bool | hasLocalValue (AbstractPropertyType propertyType) const |
Evaluates whether there is a local value set for the property. More... | |
bool | hasNonClassValue (AbstractPropertyType propertyType) const |
Evaluates whether there is a value of any precedence higher than class default value set for the property. More... | |
void | removeLocalValue (AbstractPropertyType propertyType) |
Removes the local value associated with the property. More... | |
void | copyLocalValue (const PropertyObject &other, AbstractPropertyType propertyType) |
Copies local value of single property from another object. More... | |
void | copyLocalValues (const PropertyObject &other) |
Copies all local values from another object. More... | |
virtual void | onPropertyChanged (AbstractPropertyType propertyType, PropertyNotificationReason reason) |
Virtual function to handle property change notifications. More... | |
template<typename DataType > | |
void | addPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, PropertyValuePrecedence precedence, void *owner) |
template<typename DataType > | |
void | removePropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, void *owner) |
template<typename DataType > | |
void | addPropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner) |
template<typename DataType > | |
void | removePropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner) |
void | validatePropertyModifiers (AbstractPropertyType propertyType) |
template<typename DataType > | |
void | addPropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner) |
template<typename DataType > | |
void | removePropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner) |
template<typename DataType > | |
size_t | getPropertyNotificationHandlerCount (const PropertyType< DataType > &propertyType) |
Gets number of current notification handlers for given property type. More... | |
Static Public Member Functions | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
static PropertyTargetInterpolatorSharedPtr | create (Domain *domain, string_view name) |
Creates a Property Target Interpolator. More... | |
![]() | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
![]() | |
static const Metaclass * | getStaticMetaclass () |
Returns the metaclass of Object class. More... | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Default implementation that returns empty editor info. More... | |
![]() | |
static const Metaclass * | getStaticMetaclass () |
Returns the metaclass of Object class. More... | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Default implementation that returns empty editor info. More... | |
Static Public Attributes | |
static MessageType< CompletedMessageArguments > | CompletedMessage |
The node to which the Property Target Interpolator is attached sends the Completed message when the Property Target Interpolator completes the interpolation. More... | |
static PropertyType< string > | InterpolatedPropertyTypeProperty |
Sets the property type that you want interpolate with a Property Target Interpolator in the node to which you attach the Property Target Interpolator. More... | |
static PropertyType< KzuPropertyBinaryTargetAttribute > | InterpolatedPropertyFieldProperty |
Sets the property field of the property type that you want to interpolate with a Property Target Interpolator. More... | |
static PropertyType< float > | AccelerationProperty |
Sets the speed at which the interpolated property reaches its new value. More... | |
static PropertyType< float > | DragProperty |
Controls the maximum interpolation speed. More... | |
![]() | |
static PropertyType< string > | NameProperty |
Name property specifies the name of node component. More... | |
Additional Inherited Members | |
![]() | |
enum | State { StateDetached, StateDetaching, StateAttaching, StateAttached } |
State indicating if component is attached to a node, detached from any node or in process of attaching/detaching. More... | |
typedef NodeComponentTargetMessageArguments | NodeComponentMessageArguments |
Legacy name for NodeComponentTargetMessageArguments. More... | |
![]() | |
typedef intrusive_ptr< AbstractPropertyTypeDescriptor::PropertyStorage > | PropertyStoragePtr |
typedef vector< PropertyStoragePtr > | PropertyStorageContainer |
typedef PropertyStorageContainer::iterator | PropertyStorageIterator |
typedef PropertyStorageContainer::const_iterator | PropertyStorageConstIterator |
typedef PropertyStorageContainer::reverse_iterator | PropertyStorageReverseIterator |
![]() | |
typedef vector< AppliedStyleEntrySharedPtr > | AppliedStyleContainer |
Applied style container. More... | |
![]() | |
template<typename TMessageType , typename TClass , typename TMethod > | |
static void | nodeComponentMessageHandler (TClass *nodeComponent, TMethod method, typename TMessageType::ArgumentsType &messageArguments) |
Handler function for node component messages. More... | |
![]() | |
AppliedStyleContainer | m_appliedStyles |
Listing of applied styles applied to this object. More... | |
Use a Property Target Interpolator when you want to dynamically set the target value of a property and want to interpolate the current value to the target value over time.
With a Property Target Interpolator you can automatically animate the change of a property value to achieve a smooth transition. Without a Property Target Interpolator Kanzi immediately applies a new value to a property. For example, when you use the Object::setProperty() function, Kanzi immediately applies a new value.
Use the InterpolatedPropertyTypeProperty to set the property type that you want the Property Target Interpolator to interpolate in the node to which you attach the Property Target Interpolator.
Property Target Interpolator emulates the behavior of a spring-damper system which never overshoots. Use these properties to control the behavior of the interpolation:
The Property Target Interpolator applies the InterpolatedPropertyTypeProperty, AccelerationProperty, and DragProperty properties only when you attach the Property Target Interpolator to a node. You cannot change the target property or interpolation behavior of the Property Target Interpolator by setting the values of these properties after the Property Target Interpolator is already attached to a node.
To create a Property Target Interpolator and set its target property and interpolation settings:
To attach a Property Target Interpolator to a node:
|
explicitprotected |
Constructor.
domain | Domain. |
name | Name of the Property Target Interpolator. |
string kanzi::PropertyTargetInterpolator::getInterpolatedPropertyType | ( | ) | const |
Gets the value of the InterpolatedPropertyTypeProperty.
void kanzi::PropertyTargetInterpolator::setInterpolatedPropertyType | ( | string_view | value | ) |
Sets the value of the InterpolatedPropertyTypeProperty.
PropertyField kanzi::PropertyTargetInterpolator::getInterpolatedPropertyField | ( | ) | const |
Gets the value of the InterpolatedPropertyFieldProperty.
void kanzi::PropertyTargetInterpolator::setInterpolatedPropertyField | ( | PropertyField | value | ) |
Sets the value of the InterpolatedPropertyFieldProperty.
float kanzi::PropertyTargetInterpolator::getAcceleration | ( | ) | const |
Gets the value of the AccelerationProperty.
void kanzi::PropertyTargetInterpolator::setAcceleration | ( | float | value | ) |
Sets the value of the AccelerationProperty.
float kanzi::PropertyTargetInterpolator::getDrag | ( | ) | const |
Gets the value of the DragProperty.
void kanzi::PropertyTargetInterpolator::setDrag | ( | float | value | ) |
Sets the value of the DragProperty.
|
static |
|
static |
Creates a Property Target Interpolator.
domain | Domain. |
name | Name of the Property Target Interpolator. |
|
protectedvirtual |
NodeComponent::attachOverride() implementation.
Reimplemented from kanzi::NodeComponent.
|
protectedvirtual |
NodeComponent::detachOverride() implementation.
Reimplemented from kanzi::NodeComponent.
|
protected |
Sends message about completion of interpolation.
The Property Target Interpolator calls this function when its interpolation completes.
playback | The Playback of the interpolation which completed. |
|
static |
The node to which the Property Target Interpolator is attached sends the Completed message when the Property Target Interpolator completes the interpolation.
|
static |
Sets the property type that you want interpolate with a Property Target Interpolator in the node to which you attach the Property Target Interpolator.
The default value of this property is "".
|
static |
Sets the property field of the property type that you want to interpolate with a Property Target Interpolator.
The default value of this property is "".
|
static |
Sets the speed at which the interpolated property reaches its new value.
Property Target Interpolator emulates the behavior of a spring-damper system which never overshoots. The Acceleration property sets the force with which the spring moves the object. The larger the value of the Acceleration property is, the faster the property reaches its new value. The default value is 1.0f.
|
static |
Controls the maximum interpolation speed.
Property Target Interpolator emulates the behavior of a spring-damper system which never overshoots. The Drag property sets the damping coefficient. The larger the value of the Drag property is, the lower is the maximum interpolation speed. The default value is 0.0f.